package com.ruoyi.exam.domain;

import com.ruoyi.common.utils.ObjectUtil;
import lombok.Data;

import java.util.Date;

@Data
public class ExamScores {
    private Integer id;
    private Long uid;
    private Integer examId; //考试ID

    private Integer scores; //综合分数
    private Integer handsOnScore; // 实操分数
    private Integer theoryScore; // 理论分数

    private Integer multipleTime; // 综合耗时
    private Integer handsOnTime; // 实操耗时
    private Integer theoryTime; // 理论耗时

    private Integer scoresRanking; // 综合分数排名
    private Integer handsOnScoreRanking; // 实操分数排名
    private Integer theoryScoreRanking; // 理论分数排名

    private Integer multipleTimeRanking; // 综合耗时排名
    private Integer handsOnTimeRanking; // 实操耗时排名
    private Integer theoryTimeRanking; // 理论耗时排名

    private Date createTime;
    private Date updateTime;

    public static ExamScores buildEmpty(){
        ExamScores scores = new ExamScores();
        scores.scores = -1;
        scores.handsOnScore = -1;
        scores.theoryScore = -1;
        scores.multipleTime = -1;
        scores.handsOnTime = -1;
        scores.theoryTime = -1;
        scores.scoresRanking = -1;
        scores.handsOnScoreRanking = -1;
        scores.theoryScoreRanking = -1;
        scores.multipleTimeRanking = -1;
        scores.handsOnTimeRanking = -1;
        scores.theoryTimeRanking = -1;
        scores.createTime = new Date();
        scores.updateTime = scores.createTime;
        return scores;
    }

    public void verifyComplete(){
        ObjectUtil.checkNull(uid ,"uid");
        ObjectUtil.checkNull(examId ,"examId");
    }
}
